<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>插面文件写法</title>
	</head>

	<body>
	 <table id="tb" border="1" width="80%"></table>
		<script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$.get("js/students.xml", function(data) {
				//console.log(data);
				var $stus = $(data).children("students").children("stu");
				//console.log($stus);
				$stus.each(function(i, ele) {
					//console.log(i,ele);
					var tr = $("<tr></tr>").appendTo("#tb");
					var prop = $(ele).children();
					//console.log(prop);
					prop.each(function(j, v) {
						$("<td>"+ v.innerHTML + "</td>").appendTo(tr);
						console.log(j, v.tagName, v.innerHTML);
					});
				});
			});
		</script>   
		<!--<script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
	    <script type="text/javascript">
	    	$.getJSON("js/student.json",function (data) {
	    		//console.log(data);
	    		$.each(data, function(i,v) {
	    			var tr=$("<tr><td>姓名：</td><td>"+v.xm+"</td><td>年龄：</td><td>"+v.age+"</td></tr>");
	    			tr.appendTo("#tb");
	    		});
	    	});
	    </script>-->
	</body>

</html>